<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Log;

class PaymentsController extends Controller
{
	public function alipayGateway()
	{
		return cashier('alibatch')->callbackWithdraw();
	}

	public function alipayNotify()
	{
		return cashier('alipay')->callbackAlipay();
	}

	public function wxpayNotify()
	{
		return cashier('wxpay')->callbackWxpay();
	}

	public function wxpayRefundNotify()
	{
		return cashier('wxpay')->callbackWxpay();
	}

	public function adapayNotify()
	{
        Log::debug("ada notify");
		return cashier('adawxmini')->callbackAdapay();
	}

	public function adapayRefundNotify()
	{
		return cashier('adawxmini')->callbackAdapay();
	}

	public function sandpayNotify()
	{
		return cashier('sandwap')->callbackSandwap();
	}

	public function sandpayReturn()
	{
		$returnUrl = app()->environment('production')
						? 'https://dwap.bjyike.shop/#/packs/pages/order/paid'
						: 'https://wao.bjyike.shop/#/packs/pages/order/paid';
		echo "<script>window.location.href='".$returnUrl."'</script>";
	}
}
